<template>
	<view class="help-container">
		<view class="items">
			<view class="item flex space-between" :class="{'mgt0':index===0}" v-for="item in listdata" :key="item.id"
				@click="goitemInfo(item.code)">
				{{item.name}}
				<uni-icons type="forward" size="20"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getNewsList
	} from '@/api/index.js';
	export default {
		data() {
			return {
				listdata: []
			};
		},
		onShow() {
			this.init()
		},

		methods: {
			init() {
				getNewsList({
					data: {

					}
				}).then(res => {
					if (res.code == 1) {
						this.listdata = res.data.list
						console.log(this.listdata);
					}
				})
			},
			goitemInfo(value) {
				uni.navigateTo({
					url: `help-detail?code=${value}`
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.help-container {
		background-color: #f6f6f6;
		min-height: 100vh;

		.items {
			border-radius: 8upx;

			background-color: #f6f6f6;
			border: 1px solid rgba($color: #000000, $alpha: 0);

			.item {
				padding: 0 20upx;
				line-height: 80upx;
				margin-top: 20upx;
				background-color: #fff;
			}

		}
	}
</style>
